"""
@author: 江同学呀
@file: sort_common.py
@date: 2025/1/8 22:49
@desc: 
"""
from espc.utils.enum_utils import EnumBase


class SortMode(EnumBase):
    """
    排序模式
    Elasticsearch supports sorting by array or multi-valued fields. The mode option controls what array value is picked
    for sorting the document it belongs to. The mode option can have the following values:
    Elasticsearch 支持按数组或多值字段排序。mode 选项控制选择哪个数组值来对它所属的文档进行排序。mode 选项可以具有以下值：
    """
    min = "min"
    """
    Pick the lowest value.
    选择最低值。
    """
    max = "max"
    """
    Pick the highest value.
    选择最高值。
    """
    sum = "sum"
    """
    Use the sum of all values as sort value. Only applicable for number based array fields.
    使用所有值的总和作为排序值。仅适用于基于数字的数组字段。
    """
    avg = "avg"
    """
    Use the average of all values as sort value. Only applicable for number based array fields.
    使用所有值的平均值作为排序值。仅适用于基于数字的数组字段。
    """
    median = "median"
    """
    Use the median of all values as sort value. Only applicable for number based array fields.
    使用所有值的中位数作为排序值。仅适用于基于数字的数组字段。
    """


class NumericType(EnumBase):
    """
    数值字段类型
    """
    double = "double"
    long = "long"
    date = "date"
    date_nanos = "date_nanos"






